﻿/**
 * 显示新闻公告的portlet，
 * 这类自定义的portlet统一由portlet_result.js调用
 */
Jxstar.currentPage = function(define) {
    var funId = define.nodeid;
	var box, href;
	
	var load = function(){
        var jz = function(){
            var ff = define.formpage;
            href = Jxstar.path;
            if (ff.indexOf('http') >= 0) {
                href = ff;
            } else {
                href = Jxstar.path + ff;
            }		
            href += "?user_id=" + Jxstar.session['user_id'] + "&dataid=" + funId;

            var frm = box.getEl().child('iframe');
            frm.dom.src = href + '&_dc=' + (new Date()).getTime();//避免缓存
            frm.show();
        };
        
        if (!box) {
            var ifrHtml = '<iframe frameborder="no" style="display:none;border-width:0;width:100%;height:100%;" ></iframe>';
        
            box = new Ext.Container({
                style:'overflow: hidden;',
                layout:'fit',
                border:false,
                html: ifrHtml
            }); 
            
            //要延时执行，避免布局对象还没创建
        	JxUtil.delay(500, jz);
        } else {
            jz();
        }
	};
	
	//加载容器中的数据
	load();
	
	//设置容器数据刷新方法
    box.reload = load;
	
	//添加查询小按钮
	box.showCall = function(target){
		
	};
	
	return box;
	
}
